﻿using StructureMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Trauberman.SOChat.StarLeaderboard.Data;
using Trauberman.SOChat.StarLeaderboard.Domain;
using Trauberman.SOChat.StarLeaderboard.Services;

namespace Trauberman.SOChat.StarLeaderboard.Scraper
{
	public class Program
	{
		static void Main(string[] args)
		{
			SetupIoC();

			StarScraper scraper = ObjectFactory.GetInstance<StarScraper>();

			scraper.Run();
		}

		private static void SetupIoC()
		{
			ObjectFactory.Initialize(x =>
			{
				x.Scan(scan =>
				{
					scan.TheCallingAssembly();
					scan.WithDefaultConventions();
				});

				x.For<IUserService>().Use<UserService>();
				x.For<IStarService>().Use<StarService>();
				x.For<IChatroomService>().Use<ChatroomService>();
				x.For<IDataContext>().Use<DataContext>();
			});
		}
	}
}
